package cn.cloudtogo.server.swagger;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.oas.annotations.EnableOpenApi;

import javax.annotation.PostConstruct;
import java.util.List;

@Slf4j
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication
@EnableOpenApi
public class SwaggerConfiguration {

    @PostConstruct
    public void postProcess() {
        log.info("Enabled swagger api docs");
    }


    public static final List<String> URLS = List.of(
            "/swagger-resources",
            "/swagger-resources/**",
            "/swagger-ui.html",
            "/swagger-ui/**",
            "/webjars/springfox-swagger-ui/**",
            "/v2/api-docs",
            "/swagger-ui/**",
            "/v3/api-docs");
}
